﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OneMile.DAL;
using OneMile.Entity.Model;

namespace OneMile.BLL
{
    public class BLLUCoupon:BaseBLL
    {

        private DALUCoupon dal;
        public DALUCoupon Dal
        {
            get
            {
                if (dal == null)
                    dal = DALFactory.getInstance().CreateUCouponDAL();
                return dal;
            }
        }

        public IList<ECoupon> GetCouponListByUserIdAndShopId(string userId, string shopId, List<String> idList)
        {
            try
            {
                return Dal.GetCouponListByUserIdAndShopId(userId, shopId, idList);
            }
            catch (Exception e)
            {

                base.WriteLog(e.Message);
                throw e;
            }
        }

        public IList<ECoupon> GetCouponListByUserId(string userId, int pageNo, int pageSize)
        {
            try
            {
                return Dal.GetCouponListByUserId(userId, pageNo, pageSize);
            }
            catch (Exception e)
            {

                base.WriteLog(e.Message);
                throw e;
            }
        }
    }
}
